import request from '@/utils/request';

// 添加附件
export function addAnnex(data) {
  return request({
    url: 'attachment',
    method: 'post',
    data: data
  });
}

// 获取附件列表
export function getAnnexList(query) {
  return request({
    url: 'attachment/list',
    method: 'get',
    params: query
  });
}

// 删除附件
export function deleteAnnex(attachmentId) {
  return request({
    url: `attachment/${attachmentId}`,
    method: 'delete'
  });
}

// 更新附件
export function updateAnnex(data) {
  return request({
    url: `attachment`,
    method: 'put',
    data: data
  });
}

// 获取单个附件信息
export function getAnnex(attachmentId) {
  return request({
    url: `attachment/${attachmentId}`,
    method: 'get'
  });
}
